package com.xd.core.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xd.core.api.dto.ConfirmSignDto;
import com.xd.core.api.dto.OfflinePayDto;
import com.xd.core.api.dto.SinglePayDto;
import com.xd.core.business.entity.Credit;
import com.xd.core.business.vo.CreditInsuranceVo;
import com.xd.core.business.vo.CreditVo;
import com.xd.core.debt.vo.GuaranteeSlipInfo;
import com.xd.core.h5.vo.AdvanceRepaymentDetail;
import com.xd.core.h5.vo.CarInsuranceDetail;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * <p>
 * 授信表 Mapper 接口
 * </p>
 *
 * @author ZX
 * @since 2025-02-23
 */
public interface CreditMapper extends BaseMapper<Credit> {

    Credit selectByCredit(Integer incomingId);

    void updateCardStatus(Integer creditId, String cardStatus);

    CreditVo selectCredit(Integer id);

    void updateCreditAmountRest(@Param("outLoan") BigDecimal outLoan, @Param("creditId") Integer creditId);

    CarInsuranceDetail selectContract(Integer incomingId);

    AdvanceRepaymentDetail advancePaymentInsurance(Integer incomingId);

    GuaranteeSlipInfo getSurrenderInfo(Integer incomingId);

    CreditInsuranceVo getSlipBusinessInsuranceDetail(Integer incomingId);

    void updateStatus(@Param("creditStatus") String creditStatus,
                      @Param("incomingId") Integer incomingId,
                      @Param("remark") String remark);

    void updateCard(@Param("credit") Credit credit, @Param("incomingId") Integer incomingId);

    void updateOutLoan(BigDecimal outLoan, Integer creditId);

    GuaranteeSlipInfo getGuaranteeSlipInfo(Integer incomingId);

    ConfirmSignDto getUserAccount(Integer incomingId);

    SinglePayDto getSingleDto(Integer incomingId);

    OfflinePayDto getOfflinePayDto(Integer incomingId);

    void updatePostServiceFee(BigDecimal totalInterest,BigDecimal newRate, Integer incomingId);
}
